using System;
using System.Collections.Generic;
using System.Text;
using SP.Parameter;

namespace SP.HwDeferredRS
{
    /// <summary>
    /// A simple base map feature
    /// </summary>
    public class BillboardScalingFusion : AbstractFusion
    {
        public BillboardScalingFusion()
        {
            // param billBoardSize
            //AddParameter(
            //    new Vec4Parameter("billBoardSize")
            //    .SetX(1)
            //    .SetY(1)
            //    .SetZ(0)
            //    .SetW(0)
            //    .SetEditable(false)
            //    );
        }

        public override string Name
        {
            get { return "BillboardScaling"; }
        }

        public override string Desc
        {
            get { return ""; }
        }

        public override Stage Stage
        {
            get { return Stage.Vertex0; }
        }

        public override int UVChannelCount
        {
            get { return 0; }
        }

        public override void Code(StringBuilder b, string platform)
        {
            AddLine(b, "pipeline.Pos_Ms.x *= lerp(1, input.UV0.z, pipeline.Pos_Ms.y);");
            AddLine(b, "pipeline.Pos_Ms.y *= input.UV0.w;");
        }
    }
}
